#include <QtGui>

class Scroll : public QScrollArea {

    Q_OBJECT

public:
    Scroll(QWidget *parent);
    void setWidget(QWidget *wid);

public slots:
    void play(bool);
    void scrollingPlay();

protected:
    void resizeEvent(QResizeEvent* e);
    void wheelEvent (QWheelEvent * e);
    void mouseMoveEvent(QMouseEvent *e);
    void leaveEvent(QEvent *);

signals:
    void notScroll(bool);
    void caretMove(int);

private:
    void setToScroll(int newToScroll);
    int caretX;
    int caretY;
    int toscroll;
    QRect *zoneR;
    QRect *zoneL;
    QTimer *timerPlay;

private slots:
    void scrolling();

};


